package com.mingliqiye.minecraft.enchantment.conflict.common;

import java.util.ArrayList;
import java.util.List;

public class ConfigPair {

    private Boolean allow;
    private List<String> allowlist;

    public ConfigPair() {}

    ConfigPair(Boolean allow, List<String> allowlist) {
        this.allow = allow;
        this.allowlist = allowlist;
    }

    public List<String> getAllowlist() {
        return allowlist;
    }

    public void setAllowlist(List<String> allowlist) {
        this.allowlist = new ArrayList<>(allowlist);
    }

    public ConfigPair add(String item) {
        allowlist.add(item);
        return this;
    }

    public ConfigPair add(String... items) {
        allowlist.addAll(List.of(items));
        return this;
    }

    public Boolean getAllow() {
        return allow;
    }

    public void setAllow(Boolean allow) {
        this.allow = allow;
    }
}
